﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Punia
{
    public partial class Interval : Form
    {
        int interval = 0;

        public Interval()
        {
            InitializeComponent();
        }

        public int TimeInterval
        {
            get
            {
                return interval;
            }
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            if (int.TryParse(tbInterval.Text, out interval))
            {
                if (interval <= 0)
                {
                    interval = 0;
                }
                else
                {
                    this.DialogResult = DialogResult.OK;
                }
            }
            else interval = 0;
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
        }
    }
}